package com.gite.nouette.admin.implementation.integrator.assembler.command;

import java.util.List;

import com.gite.nouette.admin.contract.integrator.assembler.command.IAssemblerCommandRemoveModule;
import com.gite.nouette.admin.contract.integrator.director.command.IDirectorCommandRemoveModule;
import com.gite.nouette.admin.contract.integrator.factory.IFactoryModel;
import com.gite.nouette.admin.contract.model.ICommand;
import com.gite.nouette.admin.contract.model.IManager;
import com.gite.nouette.admin.contract.model.command.ICommandModule;
import com.gite.nouette.admin.contract.observer.IObserver;
import com.gite.nouette.admin.implementation.integrator.builder.command.BuilderCommandRemoveModuleImpl;
import com.gite.nouette.admin.implementation.integrator.director.command.DirectorCommandRemoveModuleImpl;

public class AssemblerCommandRemoveModuleImpl implements
		IAssemblerCommandRemoveModule {
	private List<ICommandModule> parentProduct;
	private IDirectorCommandRemoveModule director;

	public AssemblerCommandRemoveModuleImpl(IFactoryModel factoryModel,
			IManager manager, IObserver<ICommand>... observers) {
		setDirector(new DirectorCommandRemoveModuleImpl());
		getDirector().setBuilder(
				new BuilderCommandRemoveModuleImpl(factoryModel, manager,
						observers));
	}

	@Override
	public List<ICommandModule> getParentProduct() {
		return this.parentProduct;
	}

	@Override
	public void setParentProduct(List<ICommandModule> parentProduct) {
		this.parentProduct = parentProduct;
	}

	@Override
	public IDirectorCommandRemoveModule getDirector() {
		return this.director;
	}

	@Override
	public void setDirector(IDirectorCommandRemoveModule director) {
		this.director = director;
	}

	@Override
	public void run() {
		getDirector().constructProduct();
		getParentProduct().add(getDirector().getProduct());
	}

}
